home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / sharew / packer / zlib / readme < prev    next >
Encoding:
Text File  |  1990-11-17  |  2.9 KB  |  73 lines

  1. zlib for atari ST
  2. -----------------
  3.  
  4. note: if you do not have or use compress, this is probably not for you...
  5.  
  6. this was posted to alt.sources circa nov 1990. i thought it would be
  7. useful so i ported it to TOS. it provides a stdio-like stream interface
  8. for reading compressed files. the args are similar to "normal" stdio. i
  9. ported it to TOS (Alcyon). it should work fine with sozobon, gcc, minix(?)
  10. and whatever, though i have not tested it with these.
  11.  
  12. what it does: it provides a READ ONLY stream interface for compressed
  13. files, i.e. those compressed which unix compress (of which there is, of
  14. course, a TOS version). up to 16-bit compress is supported. to write
  15. compressed files, you can do something like:
  16.  
  17.     write_to_tmp_file (buf, tmpfilename);
  18.     sprintf (cmd, "compress %s", tmpfilename);
  19.     system (cmd);
  20.  
  21. no support for "zfputc" or "zfputs" or "zprintf" is provided here. still,
  22. this is very useful indeed. currently it might be limited to compressed
  23. text files, at least with alcyon, though that will probably not be the
  24. case with gcc. i also runs fine under unix.
  25.  
  26. included are:
  27.  
  28.     zfopen        open a compressed (or normal) file
  29.     zfclose        closes compressed stream
  30.     zfgetc        get a single char from stream (does cr-lf translation)
  31.     zfgets        get a single line from stream
  32.     zfeof        test for EOF on stream
  33.     zfilter        for working with stdin
  34.  
  35. note that you MUST zfclose a file to free memory. exit/_exit will not do
  36. this for you (obviously).
  37.  
  38. i have not tried working with zfilter for reading stdin. this is really
  39. compiler/library/shell dependent since stdin must be read binary (the cr-lf
  40. issue). my environment does not permit this (gulam), at least not to my
  41. knowledge.
  42.  
  43. zfopen will currently only open compressed ascii files (DOS, TOS). zfgetc
  44. will check for a cr-lf and return only the linefeed. if the file is compressed,
  45. it normally has a .z extension. if not, zfopen will check to see if the file
  46. is in fact compressed. if not, zfgetc/zfgets will still read it using fgetc,
  47. though the read will be slower than using fgetc directly.
  48.  
  49. i have not tested zfgets but it looks ok, more or less. see original author's
  50. comments in the src.
  51.  
  52. this library will handle 16-bit compressed files. it has been tested with
  53. 16-bit compress 4.3 for the atari ST:
  54.  
  55.     compress 4.3 88/12/26 08:00:00 don
  56.     Options: Unix MAXBITS = 16
  57.  
  58. makefile will build a library ("make initial" first time, then "make all"
  59. during development) and a version of zcat for testing ("make test"). to
  60. run the tests, do "make runtest" which uses file "ascii" for the tests.
  61. you will need compress(1) and cmp(1) to test.
  62.  
  63. i have included an executable for zcat (the test program). see makefile
  64. for how to run it. all included in this post are alcyon-compatible libraries
  65. and aln index file (zlib.ndx). zlib.out is log of atari doindex command for
  66. aln random libraries.
  67.  
  68. enjoy...
  69.  
  70. -bill rosenkranz
  71. rosenkra%c1yankee@convex.com
  72.  
  73.